#pragma once

/// <summary>
/// PlayerInfo: Responsible for storing player mesh and collision info, and performing player collision checks
/// <summary>

/**	
  * Author: Michael Leviston
  * Created: 05/06/13
  * Last Modified: 30/06/13
  * Version: V1
  */

// Includes
#include <D3D11.h>
#include <xnamath.h>
#include "common\d3dUtil.h"
#include "common\MathHelper.h"
#include "common\xnacollision.h"
#include "BasicMesh.h"
#include "GeometryFactory.h"
#include "InstanceMap.h"
#include "ModelData.h"

using namespace XNA;

// Class Definition
class PlayerInfo
{
public:
//==============================
// Constructors / Destructors
//==============================

	/// Default Constructor
	PlayerInfo();

	/// Default Destructor
	~PlayerInfo();

//==============================
// Initialise
//==============================

  /**
	* Initialise the player info instance
	* @param D3D Device Pointer
	* @param Player Starting Position
	* @param Player Starting Velocity
	* @param Vertex Buffer containing player cylinder data
	* @param Index Buffer containing player cylinder data
	* @param Material of the player cylinder
	*/
	void Init(ID3D11Device* md3dDevice, XMFLOAT3 position, XMFLOAT3 velocity, ID3D11Buffer* cylinder_vb, ID3D11Buffer* cylinder_ib, Material* material); 

//==============================
// Shutdown
//==============================

	/// Shutdown - Release and delete player mesh and other data
	void Shutdown();

//==============================
// Get and Set Methods
//==============================

  /**
	* Set the Position of the player
	* @param Position
	*/
	void SetPosition(XMFLOAT3 position);

  /**
    * Get the Position of the Player
	* @return Position
	*/
	XMFLOAT3 GetPosition();

  /**
	* Set the Velocity of the player
	* @param Velocity
	*/
	void SetVelocity(XMFLOAT3 velocity);

  /**
    * Get the Velocity of the Player
	* @return Velocity
	*/
	XMFLOAT3 GetVelocity();

  /**
	* Set the Mesh of the player
	* @param Pointer to mesh data
	*/
	void SetMesh(BasicMesh* mesh);

  /**
    * Get the Mesh of the Player
	* @return Pointer to mesh data
	*/
	BasicMesh* GetMesh();

  /**
	* Set the Collision Box of the player
	* @param Pointer to collision box data
	*/
	void SetCollisionBox(AxisAlignedBox* collisionBox);

  /**
    * Get the Collision Box of the Player
	* @return Pointer to collision box data
	*/
	AxisAlignedBox* GetCollisionBox();

//==============================
// Player Movement Collision
//==============================

  /**
	* Check Player Movement Collision
	* @param Pointer to a vector containing all of the instance maps within the scene
	* @param Pointer to a vector containing all of the model data within the scene
	* @param Pointer to the input velocity of the player
	* @param Delta Time since last update
	*/
	void CheckMovementCollision(std::vector<InstanceMap*>* vInstanceMaps, std::vector<ModelData*>* vModelData, XMFLOAT3& inputVelocity, float dt);

private:

	BasicMesh*		m_mesh;				///< Pointer to Basic Mesh data for the player model
	AxisAlignedBox*	m_collisionBox;     ///< Pointer to Collision Box data for the player
	
};